Install Packages and Load Data
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.1 ✔ readr 2.1.4
## ✔ forcats 1.0.0 ✔ stringr 1.5.0
## ✔ ggplot2 3.4.1 ✔ tibble 3.2.1
## ✔ lubridate 1.9.2 ✔ tidyr 1.3.0
## ✔ purrr 1.0.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(readxl)
library(plotly)
##
## Attaching package: 'plotly'
##
## The following object is masked from 'package:ggplot2':
##
## last_plot
##
## The following object is masked from 'package:stats':
##
## filter
##
## The following object is masked from 'package:graphics':
##
## layout
library(hrbrthemes)
## NOTE: Either Arial Narrow or Roboto Condensed fonts are required to use these themes.
## Please use hrbrthemes::import_roboto_condensed() to install Roboto Condensed and
## if Arial Narrow is not on your system, please see https://bit.ly/arialnarrow
library(lubridate)
Follower_metrics <- read_excel("LinkedIn_followers.xlsx", sheet = "New followers")
Follower_location <- read_excel("LinkedIn_followers.xlsx", sheet = "Location")
Follower_function <- read_excel("LinkedIn_followers.xlsx", sheet = "Job function")
Follower_seniority <- read_excel("LinkedIn_followers.xlsx", sheet = "Seniority")
Follower_industry <- read_excel("LinkedIn_followers.xlsx", sheet = "Industry")
Follower_size <- read_excel("LinkedIn_followers.xlsx", sheet = "Company size")
Visitor_metrics <- read_excel("LinkedIn_visitors.xlsx", sheet = "Visitor metrics")
Visitor_location <- read_excel("LinkedIn_visitors.xlsx", sheet = "Location")
Visitor_function <- read_excel("LinkedIn_visitors.xlsx", sheet = "Job function")
Visitor_seniority <- read_excel("LinkedIn_visitors.xlsx", sheet = "Seniority")
Visitor_industry <- read_excel("LinkedIn_visitors.xlsx", sheet = "Industry")
Visitor_size <- read_excel("LinkedIn_visitors.xlsx", sheet = "Company size")
Visitor metrics
str(Visitor_metrics)
## tibble [89 × 25] (S3: tbl_df/tbl/data.frame)
## $ Date : chr [1:89] "08/09/2022" "08/10/2022" "08/11/2022" "08/12/2022" ...
## $ Overview page views (desktop) : num [1:89] 4 2 8 2 1 3 4 3 13 19 ...
## $ Overview page views (mobile) : num [1:89] 5 0 17 0 0 0 0 0 65 5 ...
## $ Overview page views (total) : num [1:89] 9 2 25 2 1 3 4 3 78 24 ...
## $ Overview unique visitors (desktop): num [1:89] 4 2 5 2 1 2 3 2 6 9 ...
## $ Overview unique visitors (mobile) : num [1:89] 4 0 4 0 0 0 0 0 28 1 ...
## $ Overview unique visitors (total) : num [1:89] 8 2 9 2 1 2 3 2 32 10 ...
## $ Life page views (desktop) : num [1:89] 0 0 0 0 0 0 0 0 0 0 ...
## $ Life page views (mobile) : num [1:89] 0 0 0 0 0 0 0 0 0 0 ...
## $ Life page views (total) : num [1:89] 0 0 0 0 0 0 0 0 0 0 ...
## $ Life unique visitors (desktop) : num [1:89] 0 0 0 0 0 0 0 0 0 0 ...
## $ Life unique visitors (mobile) : num [1:89] 0 0 0 0 0 0 0 0 0 0 ...
## $ Life unique visitors (total) : num [1:89] 0 0 0 0 0 0 0 0 0 0 ...
## $ Jobs page views (desktop) : num [1:89] 1 0 1 0 1 0 1 1 2 3 ...
## $ Jobs page views (mobile) : num [1:89] 1 1 0 0 0 0 0 0 6 1 ...
## $ Jobs page views (total) : num [1:89] 2 1 1 0 1 0 1 1 8 4 ...
## $ Jobs unique visitors (desktop) : num [1:89] 1 0 1 0 1 0 1 1 2 3 ...
## $ Jobs unique visitors (mobile) : num [1:89] 1 1 0 0 0 0 0 0 3 1 ...
## $ Jobs unique visitors (total) : num [1:89] 2 1 1 0 1 0 1 1 5 4 ...
## $ Total page views (desktop) : num [1:89] 5 2 11 3 5 3 5 5 19 28 ...
## $ Total page views (mobile) : num [1:89] 7 1 29 0 0 0 0 0 111 7 ...
## $ Total page views (total) : num [1:89] 12 3 40 3 5 3 5 5 130 35 ...
## $ Total unique visitors (desktop) : num [1:89] 4 2 5 2 2 2 3 3 7 9 ...
## $ Total unique visitors (mobile) : num [1:89] 4 1 4 0 0 0 0 0 28 2 ...
## $ Total unique visitors (total) : num [1:89] 8 3 9 2 2 2 3 3 33 11 ...
#Comparing Total Page Views - Desktop vs. Mobile
Visitor_metrics$Date <- as.Date(Visitor_metrics$Date, format = "%m/%d/%Y")
p_desktop <- Visitor_metrics %>%
ggplot(aes(x=Date, y=`Total page views (desktop)`)) +
geom_area(fill="#69b3a2", alpha=0.5) +
geom_line(color="#69b3a2") +
ylab("Total Page Views") +
labs(title="Desktop Total Page Views") +
theme_ipsum()
p_desktop <- ggplotly(p_desktop)
p_desktop
p_mobile <- Visitor_metrics %>%
ggplot(aes(x=Date, y=`Total page views (mobile)`)) +
geom_area(fill="sienna1", alpha=0.5) +
geom_line(color="sienna1") +
ylab("Total Page Views") +
labs(title="Mobile Total Page Views") +
theme_ipsum()
p_mobile <- ggplotly(p_mobile)
p_mobile